<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp"%>
 <%@ include file="/common/metaInput.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>湖南省星讯科技发展有限公司-ERP</title>
   
    <link href="${ctx}/js/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" /> 
    <script src="${ctx}/js/jquery/jquery-1.7.1.min.js" type="text/javascript"></script>    
    <script src="${ctx}/js/ligerUI/js/ligerui.min.js" type="text/javascript"></script> 
    <script src="${ctx}/js/jsp/index.js" type="text/javascript"></script>
    <script src="${ctx}/js/print/LodopFuncs.js" type="text/javascript"></script>
    <script src="${ctx}/js/print/indexPrint.js" type="text/javascript"></script>
 	
	<link rel="stylesheet" type="text/css" href="${ctx}/css/index.css" />
	<script type="text/javascript">
	var ctx="${ctx}";
	var tab = null;
	var accordion = null;
// 	var treeIcon1 = '${ctx}/js/ligerUI/skins/icons/archives.gif';
// 	var treeIcon2 = '${ctx}/js/ligerUI/skins/icons/attibutes.gif';
	var treeIcon1 = '${ctx}/js/ligerUI/skins/icons/tree1.png';
	var treeIcon2 = '${ctx}/js/ligerUI/skins/icons/tree2.png';
	var indexdata={};
	indexdata=${meun};
	$(function (){
		 for(var key in indexdata){
			
			 var o1= indexdata[key];
			// <ul id="tree1" ></ul>;
			 $("#accordion1").append("<div id=\""+key+"\" title=\""+o1["text"]+"\" class=\"l-scroll\">");
			 if("tree"==o1["type"]){//为树形结构
				 $("#"+key).append("<ul id=\""+key+"_tree\" ></ul>");
				
				//树
	             var tmptree=$("#"+key+"_tree").ligerTree({
	                 data : o1.children,
	                 checkbox: false,
	                 slide: false,
	                 nodeWidth: 115,
	                 attribute: ['nodename', 'url'],
	                 onSelect: function (node)
	                 {
	                     if (!node.data.url) return;
	                     var tabid = $(node.target).attr("tabid");
	                     if (!tabid)
	                     {
	                         tabid = new Date().getTime();
	                         $(node.target).attr("tabid", tabid)
	                     } 
	                     f_addTab(tabid, node.data.text, node.data.url);
	                 }
	             });
				 
				 tmptree = $("#"+key+"_tree").ligerGetTreeManager();
				 tmptree.collapseAll(); 
			 }else if("tab"==o1["type"]){
				 $("#"+key).append("<ul id=\""+key+"_tab\" ></ul>");
				 for(var tb1 in o1.children){
					 var otb1=o1.children[tb1];
					 $("#"+key+"_tab").append("<a class=\"l-link\" href=\"javascript:f_addTab('"+key+"_tab"+tb1+"','"+otb1["text"]+"','"+otb1["url"]+"')\">"+otb1["text"]+"</a> ");
				 }
			 }
		 }
		
		
		 $("#layout1").ligerLayout({ leftWidth: 200, height: '100%',heightDiff:-24,space:4, onHeightChanged: f_heightChanged });
		   
		 var height = $(".l-layout-center").height();
		 $("#framecenter").ligerTab({ height: height });
		 //面板
	     $("#accordion1").ligerAccordion({ height: height - 24, speed: null });
	     
	     $(".l-link").hover(function ()
	     {
	         $(this).addClass("l-link-over");
	     }, function ()
	     {
	         $(this).removeClass("l-link-over");
	     });
	     
	     
	     
	     tab = $("#framecenter").ligerGetTabManager();
	     accordion = $("#accordion1").ligerGetAccordionManager();
	     $("#pageloading").hide();
	  })
	
	function f_heightChanged(options)
	{
	    if (tab)
	        tab.addHeight(options.diff);
	    if (accordion && options.middleHeight - 24 > 0)
	        accordion.setHeight(options.middleHeight - 24);
	}
	
	function f_addTab(tabid,text, url)
	{ 
		if(url.indexOf(".do")>0||url.indexOf(".jsp")>0){
			 tab.addTabItem({ tabid : tabid,text: text, url: sys_context+url });
		}
	} 
	
	</script>
</head>

<body style="padding:0px;background:#EAEEF5;" >  
<div id="pageloading"></div>  
<div id="topmenu" class="l-topmenu">
    <div class="l-topmenu-logo">湖南省星讯科技发展有限公司-ERP</div>
    <div class="l-topmenu-welcome">
        <a href="#" class="l-link2">欢迎</a>
        <span class="space">|</span>
        <a href="#" class="l-link2" >
             ${user.name}登陆
                    
        </a> 
        <span class="space">|<a href="${ctx}/j_spring_security_logout" class="l-link2" >注销</a></span>
    </div> 
</div>
  <div id="layout1" style="width:99.2%; margin:0 auto; margin-top:4px; "> 
        <div position="left"  title="主要菜单" id="accordion1"> 

                   
           </div>
        <div position="center" id="framecenter"> 
            <div tabid="home" title="主页" style="height:300px" >
                <iframe frameborder="0" name="home" id="home" src="${ctx}/yd/welcome.do"></iframe>
            </div> 
        </div> 
        
    </div>
    <div  style="height:22px; line-height:22px; text-align:center;">
            Copyright © 2014
    </div>
    <div style="display:none"></div>
</body>
</html>
